﻿namespace CKFinder
{
    using System;

    public class TriStateBool
    {
        private int _Value;
        public const int False = 0;
        public const int True = 1;
        public const int Undefined = 2;

        public static implicit operator int(TriStateBool value)
        {
            return value._Value;
        }

        public static implicit operator TriStateBool(bool value)
        {
            TriStateBool @bool = new TriStateBool();
            @bool._Value = value ? 1 : 0;
            return @bool;
        }

        public static implicit operator TriStateBool(int value)
        {
            TriStateBool @bool = new TriStateBool();
            @bool._Value = value;
            return @bool;
        }
    }
}

